import 'dart:async';

import 'package:event_bus/event_bus.dart';
import 'package:flutter/widgets.dart';
import 'package:fluttertoast/fluttertoast.dart';

class ToastSingleton {
  static final ToastSingleton _instance = ToastSingleton._internal();
  FToast? _toast;

  factory ToastSingleton() {
    return _instance;
  }

  ToastSingleton._internal() {
    // 初始化操作
  }

  static FToast getInstance(BuildContext context) {
    _instance._toast = FToast();
    _instance._toast!.init(context);

    return _instance._toast!;
  }
}
